import { defineStore } from 'pinia'
import { UserInfo } from "../types/user";
import { Statistics } from "../types/config";
import { Menu,AsMenu } from '../types/menu'
import { ref } from 'vue';
export const useUserStore = defineStore({
  id: 'user',
  state: () => {
    return {
      userInfo: <UserInfo><unknown>[],
      statistics: <Statistics><unknown>[],
      userMenu: ref([<Menu>{}]),
      menuBottons: ref([<AsMenu>{}]),
    }
  },
  persist: {
    storage: localStorage,
    paths: ['userInfo', 'statistics', 'userMenu','menuBottons'],
  }
  
})